package whisper.support.user.service;

import org.springframework.cache.annotation.Cacheable;
import whisper.support.user.domain.User;

import java.util.List;

/**
 * Created by JT on 2018/5/14
 */
public interface UserService {

    /**
     * 检查用户是否有效
     * @param username
     * @param password
     * @return
     */
    User checkUser(String username, String password);

    /**
     * 通过用户名查找用户
     * @param username
     * @return
     */
    @Cacheable(cacheNames = "users", key = "#username")
    User findByUsername(String username);

    /**
     * 获取用户列表
     * @return
     */
    List listUsers();
}
